From: Jan Beulich Date: Thu, 22 Jan 2015 11:48:40 +0000 (+0100) Subject: x86: correctly check for sub-leaf zero of leaf 7 in pv_cpuid() X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~3888 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=ae1edef1ae33f3bcff2580116ae2b7c9ffef42f2;p=xen.git x86: correctly check for sub-leaf zero of leaf 7 in pv_cpuid() Only the low 32 bits are relevant. For consistency also change a cast on regs->eax to regs->_eax. Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper --- diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index bd04dad487..a8d7bb673b 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -881,7 +881,7 @@ void pv_cpuid(struct cpu_user_regs *regs) } } - switch ( (uint32_t)regs->eax ) + switch ( regs->_eax ) { case 0x00000001: /* Modify Feature Information. */ @@ -916,7 +916,7 @@ void pv_cpuid(struct cpu_user_regs *regs) break; case 0x00000007: - if ( regs->ecx == 0 ) + if ( regs->_ecx == 0 ) b &= (cpufeat_mask(X86_FEATURE_BMI1) | cpufeat_mask(X86_FEATURE_HLE) | cpufeat_mask(X86_FEATURE_AVX2) |